﻿
using BCCommon;
using BCCommon.Enums;
using BCData.Trading.SaleGoods.SaleGoods;
using BCDto.Trading.SaleGoods.SaleGoods;
using BCDto.Trading.SaleGoods.SaleGoodsNorm;
using BCEntity.Trading.SaleGoods.SaleGoods;
using BCService.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BCService.Trading.SaleGoods.SaleGoods
{
    /// <summary>
    /// 销售商品
    /// </summary>
    public interface ISaleGoodsService
    {
        #region  销售商品成员方法
        /// <summary>
        /// 是否存在此记录
        /// </summary>
        /// <param name="saleGoodsId">销售商品Id</param>
        bool Exists(long saleGoodsId);
        /// <summary>
        /// 是否存在此商品SKU
        /// </summary>
        /// <param name="sku">SKU</param>
        /// <returns></returns>
        bool SKUExists(string sku);
        /// <summary>
        /// 添加销售商品
        /// </summary>
        /// <param name="requestDto">销售商品信息</param>
        SaleGoodsDto Add(SaleGoodsRequestDto requestDto);
        /// <summary>
        /// 更新销售商品
        /// </summary>
        /// <param name="putDto">销售商品信息</param>
        SaleGoodsDto Update(SaleGoodsPutDto putDto);
        /// <summary>
        /// 删除销售商品
        /// </summary>
        /// <param name="saleGoodsId">销售商品Id</param>
        bool Delete(long saleGoodsId);
        /// <summary>
        /// 获取销售商品
        /// </summary>
        /// <param name="saleGoodsId">销售商品Id</param>
        SaleGoodsDto Get(long saleGoodsId);
        /// <summary>
        /// 获取销售商品列表
        /// </summary>
        IEnumerable<SaleGoodsDto> GetList();
        /// <summary>
        /// 获取销售商品分页列表
        /// </summary>
        /// <param name="saleGoodsCategoryId">商品分类Id</param>
        /// <param name="categoryName">商品分类名称</param>
        /// <param name="goodsName">商品名称</param>
        /// <param name="sku">商品SKU</param>
        /// <param name="enabled">启用</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">销售商品每页数据条数</param>
        PageableList<SaleGoodsDto> Query(long? saleGoodsCategoryId, string categoryName, string goodsName, string sku, bool? enabled, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 获取销售商品分页列表
        /// </summary>
        /// <param name="saleGoodsCategoryId">商品分类Id</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">销售商品每页数据条数</param>
        PageableList<SaleGoodsViewDto> GetMakeStaticPageListForSaleGoodsQuery(long? saleGoodsCategoryId, int pageIndex, int pageSize);
        /// <summary>
        /// 启用销售商品
        /// </summary>
        /// <param name="saleGoodsId">销售商品Id</param>
        bool Enabled(long saleGoodsId);
        /// <summary>
        /// 禁用销售商品
        /// </summary>
        /// <param name="saleGoodsId">销售商品Id</param>
        bool Disabled(long saleGoodsId);
        #endregion  销售商品成员方法

        #region  销售商品规格成员方法
        /// <summary>
        /// 是否存在此记录
        /// </summary>
        /// <param name="saleGoodsNormId">销售商品规格Id</param>
        bool GoodsNormExists(long saleGoodsNormId);
        /// <summary>
        /// 添加销售商品规格
        /// </summary>
        /// <param name="requestDto">销售商品规格信息</param>
        SaleGoodsNormDto AddGoodsNorm(SaleGoodsNormRequestDto requestDto);
        /// <summary>
        /// 更新销售商品规格
        /// </summary>
        /// <param name="putDto">销售商品规格信息</param>
        SaleGoodsNormDto UpdateGoodsNorm(SaleGoodsNormPutDto putDto);
        /// <summary>
        /// 删除销售商品规格
        /// </summary>
        /// <param name="saleGoodsNormId">销售商品规格Id</param>
        bool DeleteGoodsNorm(long saleGoodsNormId);
        /// <summary>
        /// 获取销售商品规格
        /// </summary>
        /// <param name="saleGoodsNormId">销售商品规格Id</param>
        SaleGoodsNormDto GetGoodsNorm(long saleGoodsNormId);
        /// <summary>
        /// 获取销售商品规格列表
        /// </summary>
        IEnumerable<SaleGoodsNormDto> GetGoodsNormList(long saleGoodsId);
        /// <summary>
        /// 获取销售商品规格分页列表
        /// </summary>
        /// <param name="categoryName">分类名称</param>
        /// <param name="goodsName">商品名称</param>
        /// <param name="sku">SKU</param>
        /// <param name="enabled">启用</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">销售商品规格每页数据条数</param>
        PageableList<SaleGoodsNormDto> QueryGoodsNorm(string sku, string categoryName, string goodsName, bool? enabled, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 启用销售商品规格
        /// </summary>
        /// <param name="saleGoodsNormId">销售商品规格Id</param>
        bool EnabledGoodsNorm(long saleGoodsNormId);
        /// <summary>
        /// 禁用销售商品规格
        /// </summary>
        /// <param name="saleGoodsNormId">销售商品规格Id</param>
        bool DisabledGoodsNorm(long saleGoodsNormId);
        #endregion  销售商品规格成员方法
    }
}